package b4.view.component.humanBeing
{
	import b4.model.vo.player.Equip;
	import b4.model.vo.player.Pack;
	import b4.view.component.pack.BasicObjItem;
	
	import org.aswing.JFrame;
	import org.aswing.JPanel;
	import org.aswing.JTabbedPane;
	
	public class HumanBeing extends JFrame
	{
		public var mainPane:JTabbedPane;
		public var humanProperty:HumanProperty;
		public function HumanBeing()
		{
			super();
			this.setIcon(null);
			this.setSizeWH(600, 400);
			this.setPreferredWidth(600);
			this.setLocationXY(280,0);
			this.setResizable(false);
			this.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
			mainPane = new JTabbedPane();
			mainPane.setPreferredHeight(400);
			mainPane.setPreferredWidth(550);
			humanProperty = new HumanProperty();
			mainPane.appendTab(humanProperty, "属性");
			mainPane.appendTab(new PassDisaster(), "渡劫");
			mainPane.appendTab(new JPanel(), "元婴");
			this.setContentPane(mainPane);
		}
		
		public function showRole(pack:Pack):void
		{
			loadEquipOn(pack);
		}
		
		public function loadEquipOn(pack:Pack):void
		{
			var equipList:Object = pack.equipList;
			for each(var equipBoxObj:EquipmentBoxObj in humanProperty.equipmentArr)
			{
				var eBoxObj:EquipmentBoxObj = equipBoxObj as EquipmentBoxObj;
				var equip:Equip = eBoxObj.boxItem.obj as Equip;
				if (equip.position == eBoxObj.position)
				{
					var basicObjItem:BasicObjItem = new BasicObjItem(equip);
					eBoxObj.loadObj(basicObjItem);
				}
			}	
		}
	}
}
